/**
 * 部门管理接口
 */

import { request } from 'umi';

//获取部门状态列表
export async function getDepartmentState() {
  return request('/departmentManage/getDepartmentState', {
    method: 'get',

  });
}

//获取部门列表
export async function getDepartmentList(params) {
  return request('/departmentManage/getDepartmentList', {
    method: 'get',
    params,
  });
}

//禁用启用部门
export async function getIsDepartment(params) {
  return request('/departmentManage/isDepartment', {
    method: 'get',
    params,

  });
}

//【新增/修改】获取修改部门列表
export async function getDepartmentInfo(params) {
  return request('/departmentManage/DepartmentInfo', {
    method: 'get',
    params,

  });
}

//【新增修改】获取部门信息列表
export async function getDepartmentNameList(params) {
  return request('/departmentManage/getDepartmentNameList', {
    method: 'get',
    params,

  });
}

//【新增修改】获取部门状态列表
export async function getDepartmentStateList(params) {
  return request('/departmentManage/getDepartmentStateList', {
    method: 'get',
    params,

  });
}

//【新增修改】获取部门状态列表
export async function checkDepartmentName(params) {
  return request('/departmentManage/checkDepartmentName', {
    method: 'get',
    params,

  });
}

//检验父部门是否是其子孙分类
export async function checkIsChildren(params) {
  return request('/departmentManage/isChildren', {
    method: 'get',
    params,

  });
}

//删除部门
export async function deleteDepartment(params) {
  return request('/departmentManage/deleteDepartment', {
    method: 'post',
    body:JSON.stringify(params),
  });
}

// 保存员工信息
export async function saveDepartment(params) {
  return request('/departmentManage/saveDepartment', {
    method: 'post',
    body:JSON.stringify(params),
  });
}
